package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.MallProtocol;
import com.rockcent.mall.lib.domain.enumclass.ProtocolType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhangjh on 2016/12/20.
 */
@Repository
public interface MallProtocolRepository extends JpaRepository<MallProtocol, Long>, JpaSpecificationExecutor,MallProtocolRepositoryCustom {

    List<MallProtocol> findByMallIdAndExpireAndIsDeleteOrderByLastUpdatedDesc(Long id, Whether expire, Whether isDelete);

    MallProtocol findByMallIdAndExpireAndProtocolTypeAndIsDelete(Long mallId, Whether expire, ProtocolType protocolType, Whether isDelete);

    List<MallProtocol> findByMallId(long mallId);
}
